/*
* ============================================================================
*  Name     : Logger.h
*  Part of  : GV60
*  Copyright: Wipo Software
* ============================================================================
*/

#ifndef DEBUG_LOGGER_H
#define DEBUG_LOGGER_H

#include <e32base.h>


#ifdef _DEBUG

void LogInit();
void LogEvent(char* n_pFilename, int n_iFileline, const char* pString, TInt iNumber);
void LogEvent(char* n_pFilename, int n_iFileline, const char* pString, TInt iNumber1, TInt iNumber2);
void LogEvent(char* n_pFilename, int n_iFileline, const char* pString1, const TDesC8& iString2 = _L8(""), const TDesC8& iString3 = _L8(""));
void LogEvent(char* n_pFilename, int n_iFileline, const TDesC8& iString, TInt iNumber);
void LogEvent(char* n_pFilename, int n_iFileline, const TDesC8& iString, TInt iNumber1, TInt iNumber2);
void LogEvent(char* n_pFilename, int n_iFileline, const TDesC8& iString1, const TDesC8& iString2 = _L8(""), const TDesC8& iString3 = _L8(""));
void LogEvent(char* n_pFilename, int n_iFileline, const char* pString1, const TDesC& iString2, const TDesC& iString3 = _L(""));


#define DEBUGCODE(code)                 code
#define DEBUGINIT()                     LogInit();
#define DEBUG1(f)                       LogEvent(__FILE__, __LINE__, f)
#define DEBUG2(f,a1)                    LogEvent(__FILE__, __LINE__, f, a1)
#define DEBUG3(f,a1,a2)                 LogEvent(__FILE__, __LINE__, f, a1, a2)

#else   // _DEBUG

#define DEBUGCODE(code)                 
#define DEBUGINIT()                     
#define DEBUG1(f)                       
#define DEBUG2(f,a1)                    
#define DEBUG3(f,a1,a2)                 

#endif  // _DEBUG

#endif  // DEBUG_LOGGER_H



#ifndef __LOGGING_H__
#define __LOGGING_H__

#include <e32base.h>

class CLogging : public CBase
{
  public:
#ifdef _DEBUG
    static void DumpDataL(const TDesC8& aData, const TDesC& aLogFile);
    static void LogL(const TInt aFirstNumber, const TInt aSecondNumber);
    static void LogL(const TInt aNumber);
    static void LogL(const TDesC& aText);
    static void LogL(const TDesC8& aText);
#endif // _DEBUG
};


#ifdef _DEBUG

#define DUMPDATA(a, b) CLogging::DumpDataL(a, b)
#define LOG(a) CLogging::LogL(a)
#define LOG2(a, b) CLogging::LogL(a, b)

#else // _DEBUG

#define DUMPDATA(a, b)
#define LOG(a)
#define LOG2(a, b)

#endif // _DEBUG

#endif // __LOGGING_H__

// End of file
